from mediator import mediator
from mediator . tests . test_assistant import make_mediator_test_keyword_args

class gui_fake :
    def __init__ ( self ) :
        self . _gui_grid = None
    def gui_grid ( self , widget , column , row , sticky ) :
        self . _gui_grid = [ widget , column , row , sticky ]

class mediator_gui_grid_tests : 
    'mediator_gui_grid'
    def __init__ ( self , test ) :
        self . _test = test
        self . _gui = gui_fake ( )
        self . _mediator = mediator ( )
        self . _mediator . register_modules ( ** make_mediator_test_keyword_args \
            ( 'gui' 
            , self . _gui 
            , None
            ) )
    def test_gui_grid ( self ) :
        self . _mediator . gui_grid ( 'my widget' , 'my column' , 'my row' , 'my sticky' )
        self . _test . assume_equal ( self . _gui . _gui_grid ,
            [ 'my widget'
            , 'my column'
            , 'my row'
            , 'my sticky'
            ] )
    def test_gui_grid_arg_names ( self ) :
        self . _mediator . gui_grid \
            ( widget = 'my widget' 
            , column = 'my column' 
            , row = 'my row' 
            , sticky = 'my sticky'
            )
        self . _test . assume_equal ( self . _gui . _gui_grid ,
            [ 'my widget'
            , 'my column'
            , 'my row'
            , 'my sticky'
            ] )
    def test_gui_grid_default_args ( self ) :
        self . _mediator . gui_grid ( 'my widget' )
        self . _test . assume_equal ( self . _gui . _gui_grid ,
            [ 'my widget'
            , None
            , None
            , None
            ] )
